// ==UserScript==
// @name           baixin_huochepiao
// @namespace      baixing
// @include        http://shanghai.baixing.com/huochepiao/
// ==/UserScript==

var _trains = ['K163', '2852'];
var _dates = ['20090108', '20090109'];




var ohead = document.getElementsByTagName("head")[0];

var userdata = document.createElement("script");
userdata.innerHTML = '<script type="text/javascript"> ';

userdata.innerHTML += 'var trains = new Array(); ';
userdata.innerHTML += 'var dates = new Array(); ';


for(var i = 0; i < _trains.length; i++)
{
   userdata.innerHTML += 'trains.push(\'';
   userdata.innerHTML += _trains[i];
   userdata.innerHTML += '\');';
}

for(var i = 0; i < _dates.length; i++)
{
   userdata.innerHTML += 'dates.push(\'';
   userdata.innerHTML += _dates[i];
   userdata.innerHTML += '\');';
}

userdata.innerHTML +=    '</script>';

GM_log(userdata.innerHTML);
//document.body.insertBefore(userdata, document.body.firstChild);
ohead.appendChild(userdata);


var htmlparser = document.createElement("script");
htmlparser.src="http://javascripthtmlextractor.googlecode.com/svn/trunk/html_extractor-0.0.1.js";
ohead.appendChild(htmlparser);

var http_request = document.createElement("script");
http_request.src="http://gmscript.googlecode.com/svn/trunk/baixing_ticket/http_request.js";
ohead.appendChild(http_request);

var ticket = document.createElement("script");
ticket .src="http://gmscript.googlecode.com/svn/trunk/baixing_ticket/baixing_huochepiao.js";
ohead.appendChild(ticket);
